package org.mechanic.exception;

import org.mechanic.core.web.HttpStatusCode;

/**
 * 数据解析异常
 */
@SuppressWarnings("serial")
public class DataParseException extends BaseException {

    public DataParseException() {
    }

    public DataParseException(Throwable ex) {
        super(ex);
    }

    public DataParseException(HttpStatusCode httpStatusCode, String message) {
        super(HttpStatusCode.defineHttpStatusCode(httpStatusCode, message));
        httpStatusCode.setMessage(message);
    }

    public DataParseException(String message) {
        this(HttpStatusCode.defineHttpStatusCode(message));
    }

    public DataParseException(String message, Throwable ex) {
        super(message, ex);
    }

    public DataParseException(HttpStatusCode httpStatusCode, Exception e) {
        super(httpStatusCode, e);
    }

    public DataParseException(HttpStatusCode httpStatusCode) {
        super(httpStatusCode);
    }

    protected HttpStatusCode getHttpStatusCode() {
        return HttpStatusCode.DATA_PARSE;
    }

}
